'use strict';

// var FFI = require('ffi');

//获取解析后的授权方法
exports.decodeLicense = function(){
	return new Promise(function(resolve, reject) {
		//授权信息
		var authInfo = {
			DeviceQty: 10000,
			Apps: [{
			    "AppID" : "BarcodeReplace", 
			    "FileSize" : 6506, 
			    "IsEffective" : true, 
			    "Type" : 0,
			    "Remark" : "", 
			    "Describe" : "", 
			    "Version" : "1.0.1011", 
			    "MouseDownImage" : "", 
			    "DisplayImage" : "", 
			    "FileName" : "2ab11cb1f8b79ac04b8945f79535f6dc.zip", 
			    "Name" : "芯片更替"
			}],
			Modules: []
		};
		if(authInfo){
			resolve(authInfo);
		}
		else{
			var newErr = new Error();
            newErr.leval = 9;
            newErr.title = '解析授权信息错误';
            newErr.message = '没有找到合法的授权信息';
            reject(newErr);
		}
	});
};
